using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace ShopForWeb.Model.Basic
{
    [Table("T_product")]
    public class Product
    {

        public long CategoryId { get; set; }


        /// <summary>
        /// 照片，文件路径
        /// </summary>
        [StringLength(50)]
        public string Photo { get; set; } = "";

        [Column(TypeName = "decimal(18,2)")]

        /// <summary>
        /// 价格
        /// </summary>

        public double Price { get; set; }

        /// <summary>
        /// 简介
        /// </summary>
        [Column(TypeName = "text")]
        public string ProductContent { get; set; } = "";

        /// <summary>
        /// 商品ID，自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long ProductId { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [StringLength(50)]
        public string ProductName { get; set; } = "";

        /// <summary>
        /// 状态
        /// </summary>

        public long StatusCode { get; set; }

        [ForeignKey("CategoryId")]
        public virtual Category OwnCaregory { get; set; } = null!;
         //public long UserId { get; set; }
       
    }
}